package com.hzsai.mininote.entity;

/**
 * @author hzsai
 * @date 2020/1/8 14:30
 * @usage:
 */
public enum NoteTypeEnum {

    /**
     * 0 -> note type
     * 1 -> plan
     * 2 -> unknown
     */

    PURE_NOTE(0), PURE_PLAN(1), UNKNOWN(2);

    private int note_type;
    NoteTypeEnum(int note_type) {
        this.note_type = note_type;
    }

    public int getId() {
        return this.note_type;
    }

    public static NoteTypeEnum getFromId(int id) {

        if (id < 0 || id >= NoteTypeEnum.values().length)
            return NoteTypeEnum.values()[NoteTypeEnum.values().length - 1];

        return NoteTypeEnum.values()[id];
    }
}
